package com.dingwen.treasure.business.controller;

import com.dingwen.treasure.base.controller.BaseViewController;
import com.dingwen.treasure.base.pojo.vo.Result;
import com.dingwen.treasure.business.service.OweFeeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 　OweFeeController: 欠费用户模拟发送消息，进行异步短信处理；异步，请求削峰 </br>
 * <ol>
 *     <li>可靠消费</li>
 *     <li>可靠投递</li>
 *     <li>顺序消费： 一个消费者只消费一个队列，一个队列只有一个消费者（需要指定顺序的消息依次放到队列）</li>
 *     <li>不重复消费：指定全局唯一的消息ID,借助三方存储实现</li>
 *     <li>消息挤压：增加消费者实例、检查生产者（控制消息生产速率）</li>
 * </ol>
 * 　@author dingwen
 * 　@date 2022/6/5
 */
@Api(tags = "欠费用户模拟发送消息")
@RestController
@Slf4j
@RequestMapping("owe")
public class OweFeeController implements BaseViewController {
    /**
     * oweFeeService
     */
    @Resource
    private  OweFeeService oweFeeService;

    /**
     * 欠费
     *
     * @return {@link Result}
     */
    @ApiOperation("欠费用户模拟发送消息")
    @GetMapping
    public void owe() {
        oweFeeService.oweFee();
    }
}
